﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Events</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>

    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
    /*code_begin*/
    $(document).ready(function () {
        var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"), { sheetCount: 3 });
        initSpread(spread);
    });

    function initSpread(spread) {
        var spreadNS = GcSpread.Sheets;
        spread.bind(spreadNS.Events.ActiveSheetChanged, function(e,args) {
            $("#eventArgs1").text(args.oldSheet.getName());
            $("#eventArgs2").text(args.newSheet.getName());
        });
    };
    /*code_end*/
    </script>
</head>
<body>
<div class="sample-turtorial">
    <div id="ss" style="width:100%; height:380px;border: 1px solid gray;"></div>

    <div class="demo-options">
        <div class="option-row">
            <label>Click the sheet tab to change the active sheet</label>
        </div>
        <div class="option-row">
            <label>Old sheet name: </label><label style="color:#4133b5" id="eventArgs1"></label>
            <label>New sheet name:</label><label  style="color:#4133b5" id="eventArgs2"></label>
        </div>
    </div>
</div>
</body>
</html>
